package com.example.jbservice.Service.Impl;

import com.example.jbservice.Dto.OutPatientFeeDto;
import com.example.jbservice.Dto.OutPatientPayDto;
import com.example.jbservice.Mapper.OutPatientFeeMapper;
import com.example.jbservice.Service.OutPatientFeeService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class OutPatientFeeServiceImpl implements OutPatientFeeService {
	@Autowired
	private OutPatientFeeMapper outPatientFeeMapper;
	@Override
	@Transactional
	public void save(OutPatientFeeDto outPatientFeeDto) {
		outPatientFeeMapper.Insert(outPatientFeeDto);

		OutPatientPayDto outPatientPayDto=new OutPatientPayDto();
		BeanUtils.copyProperties(outPatientFeeDto,outPatientPayDto);

		outPatientFeeMapper.InsertPay(outPatientPayDto);

	}
}
